def listSum(numlist):
    if len(numlist) == 1:
        return numlist[0]
    else:
        return numlist[0] + listSum(numlist[1:])

if __name__ == '__main__':
    print(listSum([1,2,45,7,9,5]))